package com.zmcc.service.impl;

import com.google.gson.Gson;
import com.zmcc.entity.VoiceNotifyTemplate;
import com.zmcc.entity.common.CommonRequest;
import com.zmcc.service.IVoiceNotifyRequest;

public class VoiceNotifyRequestCommercial implements IVoiceNotifyRequest {
    private final static String url = "https://dev.cmccopen.cn/api";

    private static VoiceNotifyRequestCommercial voiceNotifyRequestCommercial;

    public static synchronized VoiceNotifyRequestCommercial getInstance() {
        if (voiceNotifyRequestCommercial == null) {
            voiceNotifyRequestCommercial = new VoiceNotifyRequestCommercial();
        }
        return voiceNotifyRequestCommercial;
    }

    @Override
    public CommonRequest getSendVoiceNotifyRequest(VoiceNotifyTemplate template) {
        CommonRequest request = new CommonRequest();
        request.setUrl(url+"/v1"+"/voice" +"/voiceNotify");
        request.setBody(new Gson().toJson(template));
        return request;
    }
}
